<template>
	<el-drawer title="人事离职详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="排序号" prop="sortNo">{{form.sortNo}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="离职类型" prop="leaveType">{{form.leaveTypeName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="离职人员" prop="userId">{{form.userName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="停薪日期" prop="lastSalaryTime">{{form.lastSalaryTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="申请日期" prop="applyTime">{{form.applyTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="计划离职日期" prop="planTime">{{form.planTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="最终离职日期" prop="factTime">{{form.factTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="最终结算工资" prop="salary">{{form.salary}}/元
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="离职去向">{{form.trace}}
					</el-form-item>
					<el-form-item label="离职手续">{{form.leaveCondition}}
					</el-form-item>
					<el-form-item label="备注说明">{{form.remark}}
					</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true" ></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				recordId: '',
				sortNo: '',
				leaveTypeName: '',
				userName: '',
				lastSalaryTime: '',
				applyTime: '',
				planTime: "",
				factTime: '',
				salary: '',
				trace:'',
				leaveCondition:'',
				attachId: '',
				remark: ''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.recordId = data.recordId
			this.form.sortNo = data.sortNo
			this.form.userName = data.userName
			this.form.leaveTypeName = data.leaveTypeName
			this.form.lastSalaryTime = data.lastSalaryTime
			this.form.applyTime = data.applyTime
			this.form.planTime = data.planTime
			this.form.factTime = data.factTime
			this.form.salary = data.salary
			this.form.trace = data.trace
			this.form.leaveCondition = data.leaveCondition
			this.form.attachId = data.attachId
			this.form.remark = data.remark
		},
	}
}
</script>

<style>
</style>
